import request from '@/utils/request'

// 查询空间管理列表
export function listLocation(query) {
  return request({
    url: '/project/location/list',
    method: 'get',
    params: query
  })
}

// 查询空间管理详细
export function getLocation(lcId) {
  return request({
    url: '/project/location/' + lcId,
    method: 'get'
  })
}

// 新增空间管理
export function addLocation(data) {
  return request({
    url: '/project/location',
    method: 'post',
    data: data
  })
}

// 修改空间管理
export function updateLocation(data) {
  return request({
    url: '/project/location',
    method: 'put',
    data: data
  })
}

// 删除空间管理
export function delLocation(lcId) {
  return request({
    url: '/project/location/' + lcId,
    method: 'delete'
  })
}


// 下载导入模板
export function importTemplate() {
  return request({
    url: '/project/location/importTemplate',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    method: 'post',
    responseType: 'blob'
  })
}

// 导入空间管理数据
export function importLocation(data) {
  return request({
    url: '/project/location/importData',
    method: 'post',
    data: data
  })
}

// 修改米标信息
export function updateLocationMarker(data) {
  return request({
    url: '/project/location/marker',
    method: 'put',
    data: data
  })
}
